//
//  ScratchMessage.h
//  EsotericDemo
//
//  Created by Temp Admin on 6/11/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ScratchMessage : NSObject
{
	@public
	uint32_t SessionID;
	int16_t PrimaryCommand, SecondaryCommand;
	uint16_t Flags;
	uint8_t Channel;
	
	@private
	NSMutableData * Data;
	int offset;
	bool readonly;
}

- (int) dataSize;
- (NSData *) getData;
- (void) setFlag : (ushort) newflag : (bool) value;
- (bool) getFlag : (ushort) theflag;
- (uint8_t) getByte;
- (NSData *) getBytes;
- (NSData *) getByteLength : (int) length;
- (uint16_t) getShort;
- (uint32_t) getInt;
- (NSString *) getString;
- (void) packByte: (uint8_t) newData;
- (void) packBytes: (uint8_t *) newData: (int) count;
- (void) packData: (NSData *) newData;
- (void) packShort: (int16_t) newData;
- (void) packShorts: (int16_t *) newData: (int) count;
- (void) packInt: (int32_t) newData;
- (void) packInts: (int32_t *) newData: (int) count;
- (void) packString: (NSString *) newData;

@end
